<template>
  <div>
    <el-breadcrumb
      separator-class="el-icon-arrow-right"
      style="margin-bottom: 30px"
    >
      <el-breadcrumb-item v-for="item in routeArr" :to="{ path: `${item.path}` }" :key="item.path"> 
        {{item.meta.title}}
      </el-breadcrumb-item>
    </el-breadcrumb>
  </div>
</template>

<script>
export default {
  name: "Breadcrumb",
  data() {
    return {
      routeArr: [{ path: "/home", meta: { title: "首页" } }],
    };
  },
  mounted() {
    this.routeArr = this.routeArr.concat(this.$route.matched)
  },
};
</script>

